<?php
define( "LOG__NONE",    0 );
define( "LOG__ERROR",   1 );
define( "LOG__VERBOSE", 2 );
define( "LOG__DEBUG",   3 );

define( "STATUS_OK",       0 );
define( "STATUS_WARNING",  1 );
define( "STATUS_CRITICAL", 2 );
define( "STATUS_UNKNOWN",  3 );

#Sortie possible 

$criticals = "";
$warnings  = "";
$unknowns  = "";
$ncommand="";
$ini_array = array();
$path = realpath(dirname(__FILE__));
if (file_exists($path.'/ws.ini')) {
	$ini_array = parse_ini_file($path.'/ws.ini', true);
}
#Configuration des options 
$cmdargs = array(
    'config_version'     => '1.0',              
    'log_level'          => LOG__NONE,
);
$log_level = LOG__DEBUG;
#date et heure de commande
#$cdate=$date->toFormat(JText::_('%Y-%m-%d %H:%M:%S'));
# Chargement du fichier ini

setStatus( STATUS_OK );

#Code retour du  SOAP service
if( $status == STATUS_OK )
   $msg = "OK|OK|NONE|".$ini_array['muller']['name']."\n";
else
    $msg = "{$criticals}{$warnings}{$unknowns}\n";

echo $msg;
exit( $status );

function _log( $log, $level )
{
    global $cmdargs;
    if( $level == LOG__ERROR )
        fwrite( STDERR, "$log\n" );
    else if( $level <= $cmdargs['log_level'] )
        print( $log . "\n" );
}			

function setStatus( $new_status )
{
    global $status;
    if( $new_status > $status )
        $status = $new_status;
}			

?>

